for mon in ('win32', 'inotify', 'macfsev', 'fallback'):
    try:
        mod = __import__('contest.monitor.' + mon, fromlist=['mainloop'])
        mainloop = mod.mainloop
        monitor_name = mon
    except ImportError:
        pass
    else:
        break
